//
//  RootViewController.m
//  穷游
//
//  Created by lanou3g on 15/12/17.
//  Copyright © 2015年 王忠奎. All rights reserved.
//

#import "RootViewController.h"
#import "RecommendViewController.h"
#import "ViewController.h"
#import "DestinationViewController.h"
#import "ForumViewController.h"
#import "MeViewController.h"
@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    
    
    //RecommendViewController推荐
    ViewController *VC=[[ViewController alloc]init];
//    RecommendViewController *recVC = [[RecommendViewController alloc]init];
    UINavigationController *recNC = [[UINavigationController alloc]initWithRootViewController:VC];
    recNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"推荐" image:[UIImage imageNamed:@"推荐.png"] tag:101];
    
    //DestinationViewController目的地
    DestinationViewController *desVC = [[DestinationViewController alloc]init];
    UINavigationController *desNC = [[UINavigationController alloc]initWithRootViewController:desVC];
    desNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"目的地" image:[UIImage imageNamed:@"目的地.png"] tag:102];
    
    //ForumViewController社区
    ForumViewController *forVC = [[ForumViewController alloc]init];
    UINavigationController *forNC = [[UINavigationController alloc]initWithRootViewController:forVC];
    forNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"社区" image:[UIImage imageNamed:@"社区.png"] tag:103];
    
    //MeViewController我的
    MeViewController *meVC = [[MeViewController alloc]init];
    UINavigationController *meNC = [[UINavigationController alloc]initWithRootViewController:meVC];
    meNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"我的" image:[UIImage imageNamed:@"我的.png"] tag:104];
    
    //设置navigationBar的背景颜色
    recNC.navigationBar.backgroundColor = [UIColor colorWithRed:0.23 green:0.7 blue:0.44 alpha:1];
    desNC.navigationBar.backgroundColor = [UIColor colorWithRed:0.23 green:0.7 blue:0.44 alpha:1];
    forNC.navigationBar.backgroundColor = [UIColor colorWithRed:0.23 green:0.7 blue:0.44 alpha:1];
    meNC.navigationBar.backgroundColor = [UIColor colorWithRed:0.23 green:0.7 blue:0.44 alpha:1];
    
    self.viewControllers = [NSArray arrayWithObjects:recNC,desNC,forNC,meNC, nil];
    
    self.tabBar.tintColor = [UIColor colorWithRed:0.23 green:0.7 blue:0.44 alpha:1];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
